<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">二级供应商用户管理&nbsp;&nbsp;-&nbsp;&nbsp;详情</li>
    </ol>
    
      <div class="ms-content-layout ">

        <ul class="nav nav-tabs ms-nav-tabs" role="tablist">
          <li role="presentation" class="active">
            <a href="${ctx.host}/supplier-users/${user.id}">基本信息</a>
          </li>
          
          <li class="pull-right">
            <div class="nav-tabs-operation">
              <a href="${ctx.host}/supplier-users/${user.id}/edit" data-target="#edit" data-toggle="modal">修改基本信息</a>&nbsp;&nbsp;
            </div>
          </li>
        </ul>

        <div class="form-horizontal ms-form form-personal-info">
        
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">登录名：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${user.loginName}</p>
            </div>
          </div>

          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;" >角色：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${secure.roles[user.authority].name}</p>
            </div>
            <label class="control-label col-xs-2" style="width: 12%;">所属供应商：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${persist.supplier(user.supplierId).name}</p>
            </div>
          </div>

          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">姓名：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${user.name}</p>
            </div>
            <label class="control-label col-xs-2" style="width: 12%;" >性别：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${user.gender}</p>
            </div>
          </div>
          
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">联系电话：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${user.mobile}</p>
            </div>
            <label class="control-label col-xs-2" style="width: 12%;" >联系地址：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${user.address}</p>
            </div>
          </div>
          
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">创建人：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${empty persist.user(user.creator) ? '' : persist.user(user.creator).loginName}</p>
            </div>
            <label class="control-label col-xs-2" style="width: 12%;" >创建时间：</label>
            <div class="col-xs-2">
              <p class="form-control-static"><fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></p>
            </div>
          </div>
          
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">最后操作人：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${empty persist.user(user.lastOperator) ? '' : persist.user(user.lastOperator).loginName}</p>
            </div>
            <label class="control-label col-xs-2" style="width: 12%;" >最后操作时间：</label>
            <div class="col-xs-2">
              <p class="form-control-static"><fmt:formatDate value="${user.lastModifyTime}" pattern="yyyy-MM-dd HH:mm:ss"/></p>
            </div>
          </div>
          
          <c:if test="${user.vam}">
            <div class="form-group ms-form-group" style="margin-top: 20px;">
              <label class="control-label col-xs-2" style="width: 12%;" >是否VAM用户：</label>
              <div class="col-xs-2">
                <p class="form-control-static">是</p>
              </div>
              <label class="control-label col-xs-2" style="width: 12%;">所属VAM部门：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${user.departmentName}</p>
              </div>
            </div>
          
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-2" style="width: 12%;">座机号码：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${user.phone}</p>
              </div>
              <label class="control-label col-xs-2" style="width: 12%;" >电子邮箱：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${user.email}</p>
              </div>
            </div>
          </c:if>
          
        </div>

        <!--  tab begin -->
        <div style="margin-top:70px;">
            <ul class="nav nav-tabs ms-nav-tabs ajax-tab"  data-content="#role-content">
               <li role="presentation">
                 <a id="userResource" href="${ctx.host}/supplier-users/${user.id}/resources" data-toggle="tab" data-target="#user-resource">菜单权限</a>
               </li>
               <li role="presentation">
                 <a id="serviceSupplier" href="${ctx.host}/supplier-users/${user.id}/suppliers" data-toggle="tab" data-target="#service-supplier">供应商管辖权限</a>
               </li>
           </ul>
           
           <div id="role-content" class="tab-content ajax-tab-content">
           </div>
       </div>
       <!--  tab end -->

        </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/authority/user/supplier-user-view.js"/>
   <script type="text/javascript">
       require(['page/authority/user/supplier-user-view'], function (page) {
           page.init()
       })
  </script>
  
</body>
</html>